Rethinking remote control for CTV device testing.

 

Automating tests for a connected TV application eventually runs into a very physical problem.

Someone still has to control the TV.

Remote device labs typically solve this problem using infrared blasters. A tester sends a command through software, and an IR blaster reproduces the signal from a remote control. Point a camera at the television, and an engineer can operate a physical device from somewhere else.

That approach, however, becomes difficult when you're trying to manage hundreds of televisions and set-top boxes.

REDspace encountered this challenge while developing its Device Lab, a system designed to give engineers remote access to large fleets of physical CTV hardware. Instead of relying on emulators, teams will be able to deploy and test applications on the devices viewers actually use.

For that system to scale, REDspace needed a reliable way to control those devices remotely. So the team began exploring whether it could remove infrared from the process entirely.

 

The limitations of infrared device control.

Infrared works well when someone is sitting on a couch with a remote control. A large automated testing environment places very different demands on it.

IR blasters can accidentally send commands to neighbouring devices. Even when emitters are positioned directly over a television's IR receiver, signals can bleed between devices.

Reliability creates another problem. A traditional remote control sends a command without knowing whether the television received it. Press the power button, for example, and the remote doesn't know whether the TV is now on or off.

That uncertainty becomes difficult to manage when software is controlling the device.

Latency can also make remote testing cumbersome. REDspace CTO Wes Gould had previously used commercial testing systems where IR commands could take seconds to reach a television. Engineers would often abandon the remote system and return to a physical device unless they needed access to a particularly obscure model.

REDspace wanted its Device Lab to support far more extensive remote testing. That required tighter control over how commands reached each television.

Akshit Bhalla, a computer engineering student at Dalhousie University, took on the challenge of developing REDspace's approach to device control.

The resulting work took REDspace beneath the infrared signal itself.

 

Sending commands directly to the TV.

A television remote doesn't simply tell a TV to increase the volume or launch an application.

It encodes that command into a modulated infrared signal. The television's IR receiver detects the signal and demodulates it to recover the underlying data.

REDspace began experimenting with bypassing that transmission process.

Instead of broadcasting an infrared signal through the air, the Device Lab can generate the underlying demodulated waveform and send it through a wired connection directly to the television.

"I'm sending the raw data directly to the TV in a language that the TV needs to understand," Bhalla says.

A microcontroller sits between REDspace's software and the physical device. It receives a command over the network and generates the signal required by the television.

Hardwiring the connection eliminates the possibility of IR commands bleeding between devices. It also gives REDspace more precise control over how those commands are delivered.

Getting that working across televisions proved more complicated.

REDspace found approximately eight or nine protocols across the devices in its inventory. A command that works with one manufacturer may need to be represented differently for another.

Existing open-source command databases provided a starting point, but many of the commands weren't usable for the Device Lab. REDspace needed to investigate the different protocols and build a database it could verify against its own hardware.

Timing created another challenge.

Televisions expect signals to follow precise timing patterns. Small deviations can cause a command to be rejected. The circuit also has to preserve signal integrity as the waveform travels between components without introducing enough noise to corrupt it.

Investigating those signals initially led REDspace to consider acquiring an oscilloscope. Bhalla eventually realized a logic analyzer was better suited to the digital signals he needed to inspect.

The device allowed him to connect directly to different points in the circuit and inspect the resulting waveforms on his computer. It also cost roughly five to 10 times less than the oscilloscope REDspace had been considering.

That experimentation helped the team reverse engineer how different televisions handled commands and reproduce those signals reliably.

 

Closing the verification loop.

Directly controlling the television solved only part of the problem. An automated testing system also needs confidence that its commands reached the intended device.

REDspace built verification into the system.

After sending a command, the system can check the interaction and provide an acknowledgement that the television received it. An automated test also periodically checks the circuit during development.

If something fails during a long test, engineers can identify when the system was last operating correctly and focus their investigation on a much smaller window.

Gould sees that verification loop as one of the most important parts of the approach.

Remote testing systems built around IR blasters can struggle to provide the same confidence. A test may issue a command, but uncertainty about whether the device actually received it introduces another possible point of failure.

Early testing of the approach has been promising. During one roughly 30-minute test, the system recorded 100% command accuracy with zero errors. A single microcontroller costing approximately $25 can theoretically control up to 10 televisions, while an individual command takes roughly 120 milliseconds to send.

The system is still under development, so those figures represent early technical testing rather than production benchmarks.

They've given REDspace enough confidence to continue building the approach into its larger Device Lab architecture.

 

Building toward automated physical device testing.

REDspace ultimately wants engineers to be able to interact with racks containing large numbers of physical CTV devices.

That could remove one of the major constraints associated with physical device testing: access.

An engineer wouldn't necessarily need to be in the same building as a particular television. A device in REDspace's lab could potentially be controlled by someone working elsewhere while still providing the responsiveness they'd expect if they were standing in front of it.

"It feels like a native experience even though you're not in the room," Gould says. "The TV can be on a different continent."

Reliable control also creates opportunities for deeper automation.

REDspace's longer-term Device Lab vision includes an orchestration layer for deploying applications and running tests across physical hardware. Eventually, AI could interact with that environment as well.

An automated system could receive a test case and issue commands to the television while observing the resulting interface. Verification from the device-control system would give it additional information about whether commands reached their destination.

For REDspace, solving that larger problem started with understanding what happens after someone presses a button on a remote.

The answer took the team inside the television, where a familiar infrared signal could be reduced to the command underneath and turned into something software could control directly.

Previous
Previous

Using AI to streamline browser performance testing.

Next
Next

Keeping device-specific fixes out of the player.